package transaction;



import java.sql.SQLException;

//事务管理类
public class TransactionManager {
  /*  private static TransactionManager instance;
    private TransactionManager(){}

    public static synchronized TransactionManager getInstance(){
        if (instance == null){
            instance = new TransactionManager();
        }
        return instance;
    }

    //0.开启事务
    public void start() throws SQLException {
        ConnectionUtil.getConnn().setAutoCommit(false);
    }
    //1.提交事务
    public void commit() throws SQLException {
        ConnectionUtil.getConnn().commit();
    }

    //2.回滚事务
    public void rollback() throws SQLException {
        ConnectionUtil.getConnn().rollback();
    }
    //3.关闭连接
    public void close() throws SQLException {
        ConnectionUtil.getConnn().close();
    }*/
}
